package uml.behavioral.responsibility_chain;

/**
 * 职责链--抽象处理者<br>
 * on 2023/1/1 1:30
 */
public class President extends Approver {
    public President(String name) {
        super(name);
        this.job = "董事长";
    }

    @Override
    public void dealWith(PurchaseRequest request) {
        if (request.getAmount() >= 10 && request.getAmount() < 15) {
            this.agree(request);
        } else {
            this.nextApprover.dealWith(request);
        }
    }
}
